package com.feature.core.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

public class PasswordUtil {

	private static final PasswordEncoder encoder = new BCryptPasswordEncoder();

	public static String encodePassword(String password) {
		return encoder.encode(password);
	}

	public static boolean validate(String plaintext, String password) {
		return encoder.matches(plaintext, password);
	}
}
